package com.twu.biblioteca;

import java.io.PrintStream;
import java.util.List;

public class ListBooks implements State{
    private final PrintStream printStream;
    private final List<String> libraryBooks;
    private State mainMenu;

    public ListBooks(PrintStream printStream, List<String> libraryBooks, State mainMenu) {
        this.printStream = printStream;
        this.libraryBooks = libraryBooks;
        this.mainMenu = mainMenu;
    }

    @Override
    public void execute() {
        for (String book : libraryBooks){
            printStream.println(book);
        }
    }

    @Override
    public State nextState() {
        return mainMenu;
    }


}
